package com.hsp.Demo_12_enum;

public class Demo_06 {
    public static void main(String[] args) {
        CallPhone callPhone = new CallPhone();
        callPhone.testWork(new Computer() {
            @Override
            public void work() {
                System.out.println("CallPhone.testWrok()方法在运行！");
            }
        });

        callPhone.testWork(()-> System.out.println("CallPhone.testWork()又在运行！"));
    }
}

interface Computer{
    void work();
}

class CallPhone{

    public void testWork(Computer computer){
        computer.work();
    }
}